/*    */ package com.hs.activation.common.config;
/*    */ 
/*    */ import io.swagger.models.auth.In;
/*    */ import java.util.Collections;
/*    */ import java.util.List;
/*    */ import org.springframework.context.annotation.Bean;
/*    */ import org.springframework.context.annotation.Configuration;
/*    */ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
/*    */ import springfox.documentation.builders.ApiInfoBuilder;
/*    */ import springfox.documentation.oas.annotations.EnableOpenApi;
/*    */ import springfox.documentation.service.ApiKey;
/*    */ import springfox.documentation.service.AuthorizationScope;
/*    */ import springfox.documentation.service.Contact;
/*    */ import springfox.documentation.service.SecurityReference;
/*    */ import springfox.documentation.service.SecurityScheme;
/*    */ import springfox.documentation.spi.DocumentationType;
/*    */ import springfox.documentation.spi.service.contexts.OperationContext;
/*    */ import springfox.documentation.spi.service.contexts.SecurityContext;
/*    */ import springfox.documentation.spring.web.plugins.Docket;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Configuration
/*    */ @EnableWebMvc
/*    */ @EnableOpenApi
/*    */ public class SwaggerConfig
/*    */ {
/*    */   @Bean
/*    */   public Docket docket() {
/* 33 */     return (new Docket(DocumentationType.OAS_30)).apiInfo((new ApiInfoBuilder())
/*    */         
/* 35 */         .contact(new Contact("郑州华砂信息技术有限公司", "", ""))
/* 36 */         .title("华砂系统认证激活服务端")
/* 37 */         .build())
/* 38 */       .securitySchemes(securitySchemes())
/* 39 */       .securityContexts(securityContexts());
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   private List<SecurityScheme> securitySchemes() {
/* 46 */     ApiKey apiKey = new ApiKey("token", "身份令牌", In.HEADER.toValue());
/* 47 */     return (List)Collections.singletonList(apiKey);
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   private List<SecurityContext> securityContexts() {
/* 54 */     return Collections.singletonList(
/* 55 */         SecurityContext.builder()
/* 56 */         .securityReferences(Collections.singletonList(new SecurityReference("token", new AuthorizationScope[] { new AuthorizationScope("global", "")
/*    */               
/* 58 */               }))).operationSelector(operationContext -> operationContext.requestMappingPattern().startsWith("/"))
/* 59 */         .build());
/*    */   }
/*    */ }


/* Location:              C:\Users\yzc\Desktop\新建文件夹 (3)\activation-0.0.16.jar!\BOOT-INF\classes\com\hs\activation\common\config\SwaggerConfig.class
 * Java compiler version: 16 (60.0)
 * JD-Core Version:       1.1.3
 */